local joyex__jinqu = fk.CreateSkill {

  name = "joyex__jinqu",

  tags = {  },

}



joyex__jinqu:addEffect(fk.EventPhaseChanging, {
  name = "joyex__jinqu",
  anim_type = "drawcard",
  events = {fk.EventPhaseChanging},
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(joyex__jinqu.name) and data.to == Player.Discard
  end,
  on_use = function(self, event, target, player, data)
    player:drawCards(2, joyex__jinqu.name)
    local n = player:getHandcardNum() - player:usedSkillTimes("joyex__qizhi", Player.HistoryTurn) - 1
    if n > 0 then
      player.room:askForDiscard(player, n, n, false, joyex__jinqu.name, false)
    end
    return true
  end,
})

return joyex__jinqu